package com.xidian.zhiancloud.ticketTemplate.ticketContentRisk;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;

public class BlindBoardBlockUpJson extends TemplateJson{
    public static JsonNode BlindBoardBlockUp() {
        ObjectMapper mapper = new ObjectMapper();
        // 添加键值对。key是条目的名称，value也是HashMap类型的键值对
        HashMap<String, Object> t1 = new LinkedHashMap<>();

        List<HashMap<String, Object>> t2 = new LinkedList<>();
        HashMap<String, Object> m1 = new LinkedHashMap<>();
        m1.put("在有毒介质的管道、设备上作业时，尽可能降低系统压力，作业点应为常压", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m2 = new LinkedHashMap<>();
        m2.put("同一管道上不同时进行两处以上的盲板抽堵作业", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m3 = new LinkedHashMap<>();
        m3.put("在有毒介质的管道、设备上作业时，作业人员穿戴适合的防护用具", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m4 = new LinkedHashMap<>();
        m4.put("易燃易爆场所，作业人员穿防静电工作服、工作鞋；作业时使用防爆灯具和防爆工具", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m5 = new LinkedHashMap<>();
        m5.put("易燃易爆场所，距作业地点30m内无其他动火作业", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m6 = new LinkedHashMap<>();
        m6.put("在强腐蚀性介质的管道、设备上作业时，作业人员已采取防止酸碱灼伤的措施", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m7 = new LinkedHashMap<>();
        m7.put("介质温度较高、可能造成烫伤的情况下，作业人员已采取防烫措施", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m8 = new LinkedHashMap<>();
        m8.put("其他安全措施：", getFiled("确认人", "String", 0, new String[]{}));

        t2.add(m1);
        t2.add(m2);
        t2.add(m3);
        t2.add(m4);
        t2.add(m5);
        t2.add(m6);
        t2.add(m7);
        t2.add(m8);

        t1.put("safe_measure", getFiled("安全措施", "string", 0, t2));
        JsonNode jsonNode = mapper.valueToTree(t1);
        System.out.println(jsonNode);
        return jsonNode;
    }
}
